﻿using System;
using System.Reflection;
using System.Threading;
using System.Windows.Forms;

namespace APBR_Patch_Mirror
{
    class Program
    {
        static void Main(string[] args)
        {
            Application.Run(new MainForm());
            Console.Title = MainForm.Progname + APBR_Patch_Mirror.ProgUpdater.buildDate;
            Console.ForegroundColor = ConsoleColor.White;
            Console.SetBufferSize(180, 300);
        }

        public static void MainLoop()
        { 
            Thread t = new Thread(delegate()
            {
                while (true)
                {
                    Console.ForegroundColor = ConsoleColor.Gray;
                    Console.Write("\n\nCommand: ");
                    Console.ForegroundColor = ConsoleColor.White;
                    def.cmd = Console.ReadLine();
                    //CmdCase.cmds();
                    Thread.Sleep(1);
                }
            }); t.IsBackground = false; t.Start();
        }

        public static void loadasm()
        {
            AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
            {
                using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("APBR_Patch_Mirror.ZipForge.dll"))
                {
                    Byte[] assemblyData = new Byte[stream.Length];
                    stream.Read(assemblyData, 0, assemblyData.Length);
                    return Assembly.Load(assemblyData);
                }
            };
        }
    }
}
